package com.hm.ibsm.repositry;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.hm.common.def.ActivateDef;
import com.hm.ibsm.domain.mg.UserDomain;
import com.hm.ibsm.util.IbsmRepository;

/**
 * @author shishun.wang
 * @date 下午11:49:11 2017年1月31日
 * @version 1.0
 * @describe
 */
@Repository
public interface IUserRepository extends IbsmRepository<UserDomain, String> {

	@Query("select u from UserDomain u where u.account = :account and u.activate = :activate")
	public UserDomain findByAccount(@Param("account") String account, @Param("activate") ActivateDef activate);

	@Query("select u from UserDomain u where u.email = :email and u.activate = :activate")
	public UserDomain findByEmail(@Param("email") String email, @Param("activate") ActivateDef activate);

	@Query("select u from UserDomain u where u.userName = :userName and u.activate = :activate")
	public UserDomain findByUserName(@Param("userName") String userName, @Param("activate") ActivateDef activate);

	@Query("select u from UserDomain u where u.mobile = :mobile and u.activate = :activate")
	public UserDomain findByMobile(@Param("mobile") String mobile, @Param("activate") ActivateDef activate);

}
